package com.deng.api.controller;

import com.deng.api.entity.CloudProduct;
import com.deng.api.service.ICloudProductService;
import com.deng.api.vo.PageVO;
import com.deng.commons.common.BaseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.eclipse.core.internal.runtime.Product;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author deng
 * @since 2022-08-10
 */
@Api(tags = "产品管理")
@RestController
@RequestMapping("/api/product")
public class CloudProductController {
    @Resource
    private ICloudProductService iCloudProductService;

    @ApiOperation("返回全部的产品")
    @GetMapping(value = "/all")
    public BaseResult getAll(@RequestParam(defaultValue = "1") Integer page,
                             @RequestParam(defaultValue = "10") Integer size,
                             CloudProduct cloudProduct){
        PageVO pageVO = iCloudProductService.getAll(page, size, cloudProduct);
        return BaseResult.success(pageVO);
    }
}
